package com.vueblog.webapi.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.vueblog.webapi.enums.ResponseEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;


/**
 * <p>
 * 通用 返回对象
 * </p>
 *
 * @author intest
 * @since 2019-07-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class BaseResponse<T> extends CommonResponse {

    /**
     * 数据集1
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private T data;

    /**
     * 数据集2
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private T data02;

    public BaseResponse(Integer code, String message) {
        super(code, message);
    }

    public BaseResponse(Integer code, String message, T data) {
        super(code, message);
        this.data = data;
    }

    public BaseResponse() {
        super(ResponseEnum.SUCCESS);
    }

    public BaseResponse(ResponseEnum re) {
        super(re);
    }

    public BaseResponse(ResponseEnum re, T data) {
        super(re);
        this.data = data;
    }

    public BaseResponse(ResponseEnum re, T data, T data02) {
        super(re);
        this.data = data;
        this.data02 = data02;
    }

    public BaseResponse(T data) {
        super(ResponseEnum.SUCCESS);
        this.data = data;
    }
}
